import request from '@/utils/request'

export function upload(params) {
    const { file, type } = params
    let formData = new FormData();
    formData.append('file', file);
    return request({
        url: '/file/upload',
        method: 'POST',
        data: formData,
        timeout: 1000 * 60 * 3,
        params: {
            type
        }
    }).then(res => {
        return res
    })
}
export function login(params) {
    return request({
        url: '/login',
        method: 'POST',
        data: params
    }).then(data => data)
}
export function logout(params) {
    return request({
        url: '/logout',
        method: 'POST',
        data: params
    }).then(data => data)
}